﻿#include "CmdCreateTwoDLineChart.h"
#include <QFile>
#include <QDebug>
#include "BaseModule/IBaseSignal.h"
#include "PostCommandPy.h"

namespace PostCommand
{
    CmdCreateTwoDLineChart::CmdCreateTwoDLineChart()
        : CommandBase()
    {
        this->initCmdName();
    }
    CmdCreateTwoDLineChart::~CmdCreateTwoDLineChart()
    {
    }

    bool CmdCreateTwoDLineChart::execute()
    {
        bool _success = false;
        emit IBaseSignalInstance->signal_set2DPlotType(m_lineChartType);
        emit IBaseSignalInstance->signal_sendSelectedInfo(m_variableIndex, m_chosenkeyList, m_valueIndexs, &_success, m_selectParserIndex, m_isOpenNewWindow);
        return _success;
    }

    void CmdCreateTwoDLineChart::undo()
    {
    }

    void CmdCreateTwoDLineChart::redo()
    {
        // execute();
    }

    void CmdCreateTwoDLineChart::setLineChartType(int type)
    {
        m_lineChartType = type;
    }
    void CmdCreateTwoDLineChart::setVariableIndex(int variableIndex)
    {
        m_variableIndex = variableIndex;
    }
    void CmdCreateTwoDLineChart::setChosenkeyList(QList<QPair<int, QList<int>>> chosenkeyList)
    {
        m_chosenkeyList = chosenkeyList;
    }
    void CmdCreateTwoDLineChart::setValueIndexs(QList<int> valueIndexs)
    {
        m_valueIndexs = valueIndexs;
    }

    void CmdCreateTwoDLineChart::setSelectParserIndex(QList<int> selectParserIndex)
    {
        m_selectParserIndex = selectParserIndex;
    }

    void CmdCreateTwoDLineChart::setIsOpenNewWindow(bool isOpenNewWindow)
    {
        m_isOpenNewWindow = isOpenNewWindow;
    }

} // namespace PostCommand
